package com.blazingredfireball.rouleurlog.ria.model
{
   import mx.collections.ICollectionView;
   import com.adobe.cairngorm.model.ModelLocator;
   import mx.collections.ArrayCollection;
   import com.blazingredfireball.rouleurlog.ria.vo.RideVO;
   import com.blazingredfireball.rouleurlog.ria.vo.BikeVO;
   import com.blazingredfireball.rouleurlog.ria.vo.RouteVO;
   import com.blazingredfireball.rouleurlog.ria.vo.UserVO;

   [Bindable]
	public class RouleurlogModelLocator implements ModelLocator
	{
      private static var modelLocator : RouleurlogModelLocator;
      
      public static function getInstance() : RouleurlogModelLocator 
      {
      	if ( modelLocator == null )
      	{
      		modelLocator = new RouleurlogModelLocator();
      	}
      		
      	return modelLocator;
      }

	      //Constructor should be private but current AS3.0 does not allow it yet (?)...
      public function RouleurlogModelLocator() 
      {	
         if ( modelLocator != null )
         {
         	throw new Error( "Only one RouleurlogModelLocator instance should be instantiated" );	
         }
         
      }
   
	  public var rides : ArrayCollection;
	  
	  public var selectedRide : RideVO;
	  
	  public var bikes : ArrayCollection;
	  
	  public var selectedBike : BikeVO;
	  
	  public var routes : ArrayCollection;
        
      public var selectedRoute : RouteVO;

	  public var user : UserVO;
	  
       
      public var viewState : String = LOGIN_VIEW; 
      
      public static const LOGIN_VIEW : String = "Login";
      
      public static const MANAGE_RIDES_VIEW : String = "Manage Rides";
      
      public static const MANAGE_BIKES_VIEW : String = "Manage Bikes";
      
      public static const MANAGE_ROUTES_VIEW : String = "Manage Routes";
       

   }
}